package com.gali.mall.exception;

/**
 * 异常枚举
 */
public enum GaLiExceptionEnum {

    NEED_USER_NAME(10001,"用户名不能为空"),
    NEED_PASSWORD(10002,"密码不能为空"),
    SYSTEM_ERROR(10003,"系统异常"),
    USER_EXISTED(10004,"用户名已经存在"),
    INSERT_FAILED(10005,"用户注册失败"),
    PASSWORD_TOO_LONG_OR_SHORT(10006,"密码长度小于8或者大于16"),
    WORN_LOGIN(10007,"用户名或密码错误"),
    UPDATE_WORN(10008,"用户未登录，更新失败"),
    LOGOUT_WARN(10009,"用户未登录，退出失败"),
    NAME_EXITS(10010,"商品名字重复"),
    ADD_ERROR(10011,"添加失败"),
    DELETE_ERROR(10012,"删除失败"),
    FORMAT_ERROR(10013,"格式错误"),
    UPDATE_ERROR(10014,"更新失败"),
    SELECT_ERROR(10015,"查询失败"),
    MKDIR_FALIED(10016,"创建目录失败"),
    UPLOAD_FALIED(10017,"上传文件失败"),
    NAME_NOT_EXIST(10018,"名字不存在"),
    PRODUCT_NO_EXIST(10019,"商品不存在"),
    QUANTITY_NOT_GET(10020,"商品库存不足"),
    CART_NOT_PRODUCT(10021,"购物车没有勾选的商品"),
    ORDER_NOT_EXIST(10022,"订单不存在"),
    ORDER_NOT_EXIST_USER(10023,"订单不属于该用户"),
    ORDER_STATUS_NOT_EXIST(10024,"订单状态不符"),
    ADMIN_ERROR(10090,"该用户无权限"),
    PARAM_ERROR(30000,"参数错误");
    //异常编码
    private Integer code;
    //异常描述信息
    private String msg;

    GaLiExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
